
package huoye.shops;

import android.media.Image;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.codeideology.android.previewimage.PrevieImage;
import com.codeideology.android.previewimage.PrevieImageActivity;
import com.codeideology.android.utils.BarUtils;
import com.codeideology.android.utils.StringUtils;
import com.jph.takephoto.model.TImage;
import com.jph.takephoto.model.TResult;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;
import huoye.shops.base.BaseTakePhotoActivity;
import huoye.shops.base.UserManager;
import huoye.shops.common.AddPictureAdapter;
import huoye.shops.common.model.OssImageData;
import huoye.shops.huoye.operation.model.AddImage;
import huoye.shops.huoye.operation.model.ShopCouponsList;
import huoye.shops.huoye.operation.presenter.LimitDiscountPresenter;
import huoye.shops.huoye.operation.view.ILimitDiscountView;


/**
 * Created by user on 2017/11/25.
 */


public class TestActivity extends BaseTakePhotoActivity  {


    @BindView(R.id.image)
    ImageView IvImage;


    @Override
    protected int getContentViewId() {
        return R.layout.activity_test;
    }

    @Override
    protected void initView(@Nullable Bundle bundle) {
        takePhoto();
    }

    @Override
    public void takeSuccess(TResult result) {
        TImage image = result.getImage();
         Glide.with(this)
                .load(new File(image.getCompressPath()))
                .centerCrop()
                .placeholder(R.mipmap.ic_wait_logo)
                .error(R.mipmap.ic_error)
                .into(IvImage);

        Log.e("takePhotoTest====","4444444444"+result.toString());

       /* String path = image.getOriginalPath();
        File file = new File(path);
        IvImage.setImageURI(Uri.fromFile(file));
        IvImage.invalidate();;*/
    }




}
